package org.okkam.webservice;

public class SearchNGProxy implements org.okkam.webservice.SearchNG {
  private String _endpoint = null;
  private org.okkam.webservice.SearchNG searchNG = null;
  
  public SearchNGProxy() {
    _initSearchNGProxy();
  }
  
  public SearchNGProxy(String endpoint) {
    _endpoint = endpoint;
    _initSearchNGProxy();
  }
  
  private void _initSearchNGProxy() {
    try {
      searchNG = (new org.okkam.webservice.SearchNGServiceLocator()).getSearchNG();
      if (searchNG != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)searchNG)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)searchNG)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (searchNG != null)
      ((javax.xml.rpc.Stub)searchNG)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public org.okkam.webservice.SearchNG getSearchNG() {
    if (searchNG == null)
      _initSearchNGProxy();
    return searchNG;
  }
  
  public org.okkam.core.api.data.OkkamURIResult search(java.lang.String query) throws java.rmi.RemoteException{
    if (searchNG == null)
      _initSearchNGProxy();
    return searchNG.search(query);
  }
  
  
}